<?php /* Smarty version Smarty-3.1.18, created on 2017-05-17 09:48:35
         compiled from "/data/www/mystery/protected/views/report/list.tpl" */ ?>
<?php /*%%SmartyHeaderCode:1367061750553defc1b8b711-64517300%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'ea0817d86955f64f193edc4fd9f301847342088d' => 
    array (
      0 => '/data/www/mystery/protected/views/report/list.tpl',
      1 => 1494904493,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1367061750553defc1b8b711-64517300',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_553defc1c184c4_71282175',
  'variables' => 
  array (
    'level' => 0,
    'list' => 0,
    'val' => 0,
    'network_names' => 0,
    'audit' => 0,
    'status' => 0,
    'network_id' => 0,
    'page' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_553defc1c184c4_71282175')) {function content_553defc1c184c4_71282175($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_date_format')) include '/data/www/mystery/protected/extensions/Smarty/plugins/modifier.date_format.php';
?><?php echo $_smarty_tpl->getSubTemplate ('../common/head.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<div class="main w1060">
	<div class="twomain">
		<div class="biaoge">  
                    <h2 class="btzong2">报备列表 Network Records<?php if ($_smarty_tpl->tpl_vars['level']->value==4) {?>
                    <span style="float:right;"><a href="/report/add">添加报备</a>&nbsp;&nbsp;&nbsp;&nbsp;</span><?php }?></h2>
		<form name="form1" id="myform" method="post" action="/report/SetStatus" >	
                    <table width="100%" border="0" cellspacing="0">
			  <tr>
                              <?php if ($_smarty_tpl->tpl_vars['level']->value!=4) {?><td bgcolor="#f5f5f5"><strong>全选</strong></td><?php }?>
                              <td bgcolor="#f5f5f5">序号</td>
                              <td bgcolor="#f5f5f5"><strong>网点名称</strong></td>
                              <td bgcolor="#f5f5f5"><strong>项目</strong></td>
                              <td bgcolor="#f5f5f5"><strong>报备内容</strong></td>
				<td bgcolor="#f5f5f5"><strong>报备起始时间</strong></td>
				<td bgcolor="#f5f5f5"><strong>报备截止时间</strong></td>
				<td bgcolor="#f5f5f5"><strong>报备状态</strong></td>
                                <td bgcolor="#f5f5f5"><strong>操作</strong></td>
			  </tr>
                          <?php if ($_smarty_tpl->tpl_vars['list']->value) {?>
                          <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
			  <tr id="nr_<?php echo $_smarty_tpl->tpl_vars['val']->value['nr_id'];?>
">
                              <?php if ($_smarty_tpl->tpl_vars['level']->value!=4) {?><td><input type="checkbox" name="nr_id[]" value="<?php echo $_smarty_tpl->tpl_vars['val']->value['nr_id'];?>
" /></td><?php }?>
                              <td><?php echo $_smarty_tpl->tpl_vars['val']->value['nr_order'];?>
</td>
                              <td><?php echo $_smarty_tpl->tpl_vars['network_names']->value[$_smarty_tpl->tpl_vars['val']->value['network_id']];?>
</td>
                              <td>
                                  <?php echo $_smarty_tpl->tpl_vars['val']->value['project']['project_name'];?>

                              </td>
				<td><?php echo $_smarty_tpl->tpl_vars['val']->value['content'];?>
</td>
                                <td><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['val']->value['start_time'],"%Y-%m-%d");?>
</td>
				<td><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['val']->value['end_time'],"%Y-%m-%d");?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['audit']->value[$_smarty_tpl->tpl_vars['val']->value['audit']];?>
<?php echo $_smarty_tpl->tpl_vars['status']->value[$_smarty_tpl->tpl_vars['val']->value['status']];?>
</td>
                                <td>
                                    <?php if ($_smarty_tpl->tpl_vars['network_id']->value==$_smarty_tpl->tpl_vars['val']->value['network_id']&&$_smarty_tpl->tpl_vars['val']->value['status']==-1) {?>
                                    <a href="/report/add?nr_id=<?php echo $_smarty_tpl->tpl_vars['val']->value['nr_id'];?>
">编辑</a> | <a href="javascript:;" onclick="del(<?php echo $_smarty_tpl->tpl_vars['val']->value['nr_id'];?>
);">删除</a>
                                    <?php } else { ?>
                                    <a href="javascript:;" onclick="history('<?php echo $_smarty_tpl->tpl_vars['val']->value['nr_id'];?>
');">历史</a>
                                    <?php }?>
                                </td>
			  </tr>
                          <?php } ?>
                            <?php if ($_smarty_tpl->tpl_vars['level']->value!=4) {?>
                            <tr>
                                <td colspan="8">
                                    <input type="checkbox" id="che_box" value="" />全选&nbsp;&nbsp;&nbsp;
                                    <input type="radio" name="status" value="1" checked="checked"/>通过<input type="radio" name="status" value="2" />不通过
                                    <input type="submit" value="提交" /><?php echo $_smarty_tpl->tpl_vars['page']->value;?>
</td>
                              </tr>
                            <?php }?>
                          <?php }?>
		  </table>
                </form>
		</div>
	</div>
</div>
<script type="text/javascript">
 function showRequest(formData, jqForm, options) { 
    return true;
}
function showResponse(responseText, statusText, xhr, $form)  { 
    alert(responseText.note);
    window.location.reload();
}
 $(function(){
    //复选框事件  
    //全选、取消全选的事件  
    $(document).on("click","#che_box",function(){
        var ischecked= $("#che_box:checked").length;

        var $checkboxs =$("input[name='nr_id[]']");
        if(ischecked){
            $checkboxs.prop("checked",true);
        }else{
            $checkboxs.prop("checked",false);
        }
    }); 
    var options = {         
        beforeSubmit:  showRequest,  
        success:       showResponse,
        dataType:  'json'
    }
    $('#myform').ajaxForm(options); 
})
//详细审核历史记录
function history(nr_id){
    $.layer({
        type: 2, 
        title: '网点报备审核历史记录',
        border:[10, 0.3, '#000'],
        closeBtn:[0, true],
        shade: [0.5, '#000'],
        offset: ['100px', ''],
        area: ['500px', '250px'],
        iframe: {src: '/report/History?nr_id='+nr_id}
    });
}
//删除
function del(nr_id){
    if (confirm('确定删除？')) {
        $.getJSON('/report/del',{nr_id:nr_id},function(res){
            if (res.status==1) {
                $('#nr_'+nr_id).remove();
            }
            alert(res.note);
        });
    }

}
</script>
<!--main End-->
<?php echo $_smarty_tpl->getSubTemplate ("../common/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
<?php }} ?>
